abstract class Shape{
    public abstract double getPerimeter();
    public abstract double getArea();
}
class Square extends Shape{
    double side;

    public double getSide() {
        return side;
    }

    public void setSide(double side) {
        this.side = side;
    }

    public Square(double side) {
        this.side = side;
    }
    public  double getPerimeter(){
        return 4 * side;
    }
    public  double getArea(){
        return side * side;
    }
}
class Rectangle extends Shape{
    double length;
    double wide;

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public double getWide() {
        return wide;
    }

    public void setWide(double wide) {
        this.wide = wide;
    }

    public Rectangle(double length, double wide) {
        this.length = length;
        this.wide = wide;
    }
    public  double getPerimeter(){
        return 2 * (this.getLength() + this.getWide());
    }
    public  double getArea(){
        return this.getLength() * this.getWide();
    }
}
class Circle extends Shape{
    double radius;

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    public Circle(double radius) {
        this.radius = radius;
    }
    public  double getPerimeter(){
        return 2 * Math.PI * this.getRadius();
    }
    public  double getArea(){
        return  Math.PI * this.getRadius() * this.getRadius();
    }
}